package com.atguigu.crowd.api;

import com.atguigu.crowd.entity.po.MemberPO;
import com.atguigu.crowd.entity.vo.*;
import com.atguigu.crowd.util.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author cyb315
 * @create 2021-11-06 10:44
 */
@FeignClient("atguigu-crowd-mysql")
public interface MySQLRemoteService {

    // 会员根据账号登录的远程接口方法
    @RequestMapping("/get/memberpo/by/login/acct/remote")
    ResultEntity<MemberPO> getMemberPOByLoginAcctRemote(@RequestParam("loginacct") String loginacct);

    // 注册会员信息的保存远程接口方法
    @RequestMapping("save/member/remote")
    public ResultEntity<String> saveMember(@RequestBody MemberPO memberPO);

    // 保存发起项目信息的远程调用接口
    @RequestMapping("/save/project/vo/remote")
    public ResultEntity<String> saveProjectVORemote(@RequestBody ProjectVO projectVO,@RequestParam("memberLoginVOId") Integer memberLoginVOId);

    // 查询项目类型信息的远程调用接口
    @RequestMapping("/get/portal/type/project/data/remote")
    public ResultEntity<List<PortalTypeVO>> getPortalTypeProjectDataRemote();

    // 查询指定项目详细信息的远程调用接口
    @RequestMapping("/get/project/detail/remote/{projectId}")
    public ResultEntity<DetailProjectVO> getDetailProjectVORemote(@PathVariable("projectId") Integer projectId);

    // 查询订单项目信息内容的远程调用接口
    @RequestMapping("/get/order/project/vo/remote")
    public ResultEntity<OrderProjectVO> getOrderProjectVORemote(@RequestParam("projectId") Integer projectId,@RequestParam("returnId") Integer returnId);

    // 查询指定用户收货地址集合的远程调用接口
    @RequestMapping("/get/address/vo/remote")
    public ResultEntity<List<AddressVO>> getAddressVORemote(@RequestParam("memberId") Integer memberId);

    // 保存新增地址信息的远程调用接口
    @RequestMapping("save/address/remote")
    public ResultEntity<String> saveAddressRemote(@RequestBody AddressVO addressVO);

    // 保存订单数据的远程调用接口
    @RequestMapping("/save/order/remote")
    ResultEntity<String> saveOrderRemote(@RequestBody OrderVO orderVO);
}
